package com.example.mobile2030606150cjk0615;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private RecyclerView rvMainUsers;
    private List<Users> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
//        list.add(new Users(1, "张三", 20, 90));
//        list.add(new Users(2, "李四", 25, 80));
        list = new MyDataAdapter().QueryAll(this);
        rvMainUsers.setAdapter(new UsersRViewAdapter(list));
    }

    private void initView() {
        rvMainUsers = (RecyclerView) findViewById(R.id.rvMainUsers);
        rvMainUsers.setLayoutManager(new LinearLayoutManager(this));
    }
}